package concurrent;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class Utils {
	private static String destination = "c://log.txt";
	private static FileWriter writer=null;
	static{
		try {
			writer = new FileWriter(new File(destination));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	
	public static void writeToLog(String text){
		try {
			writer.append(text);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static void close(){
		if(writer != null)
			try {
				writer.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
	}
	
}
